#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdlib.h>

int main()
{
	int* arr = (int*)malloc(20);
	if (arr == NULL)
	{
		perror("malloc");

	}
	int i = 0;
	for (i = 0; i < 5; i++)
	{
		printf("%d\n", arr[i]);
	}

	int* ptr = (int*)realloc(arr, 40);
	if (ptr == NULL)
	{
		perror("realloc");
		return 0;
	}
	arr = ptr;
	ptr = NULL;
	for (i = 0; i < 10; i++)
	{
		printf("%d\n", arr[i]);
	}

	free(arr);
	arr = NULL;
	return 0;
}